﻿//UserDelivery.aspx.cs
////////////////////////////////////////
////////////////////////////////////////
//点击用户信息查看页面里的查看订单按钮时显示，显示指定用户的所有订单
////////////////////////////////////////
////////////////////////////////////////
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;

public partial class UserDelivery : System.Web.UI.Page
{
    CommonClass ccObj = new CommonClass();
    protected void Page_Load(object sender, EventArgs e)
    {
        this.BindUserDelivery();
    }
    private void BindUserDelivery()
    {
        String username = Request.Params["username"];
        DataTable dtDelivery = new DataTable();
        /////////////////////////////////
        /////////////////////////////////
        //通过用户名得到相应的dtDelivery，并将查询到的表dtDelivery数据绑定到DeliveryView中。
        /////////////////////////////////
        /////////////////////////////////
        this.DeliveryView.DataSource = dtDelivery;
        this.DeliveryView.DataBind();
    }
    protected void lnkbtnCheck_Command(object sender, CommandEventArgs e)
    {
        //查看指定的订单，其中，查看按钮(lnkbtnCheck)的CommandArgument参数值为订单ID代号
        Response.Redirect("DeliveryDetail.aspx?orderID="+e.CommandArgument);
    }
    protected void DeliveryView_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        DeliveryView.PageIndex = e.NewPageIndex;
        this.BindUserDelivery();
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        Response.Redirect("ShowUser.aspx");
    }
}
